#include "view.h"

View::View(QGraphicsScene *scene) : QGraphicsView(scene)
{
    setWindowFlags(windowFlags() | Qt::FramelessWindowHint);
    setAttribute(Qt::WA_TranslucentBackground, true);
    setStyleSheet(styleSheet() + "border:0px; background: transparent;");
    setMouseTracking(true);
}

void View::resizeEvent(QResizeEvent *event)
{
    QGraphicsView::resizeEvent(event);
    fitInView(sceneRect(), Qt::KeepAspectRatio);
}

void View::slotMoved(QPoint offset)
{
    move(pos() + offset);
}

void View::resizeFactorChanged(double factor)
{
    resize(1381 * factor, 889 * factor);
}
